<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" />
	<xsl:param name="WhichType" select="'Watchfire.WordReporter.FieldNames'" />
	<xsl:template match="doc">
		<xsl:apply-templates select="./assembly/name" />
		<H2>
			Members
		</H2>
    
  </xsl:template>


  <xsl:template match="member" mode="fields">
    <xsl:if test="position() = 1">
      <tr>
        <th>Mail Merge Field Name</th>
        <th>AppScan Data</th>
      </tr>
    </xsl:if>

    <tr>
      <td class="fieldName">
        <xsl:if test="starts-with(substring-after(@name,concat($WhichType,'.')),'i')">
          <xsl:value-of select="concat('WF:I',substring-after(@name,concat($WhichType,'.i')))" />
        </xsl:if>
        <xsl:if test="starts-with(substring-after(@name,concat($WhichType,'.')),'v')">
          <xsl:value-of select="concat('WF:V',substring-after(@name,concat($WhichType,'.v')))" />
        </xsl:if>
      </td>
      <td class="fieldDesc">
        <xsl:apply-templates select="remarks | summary | value" />
      </td>
    </tr>
  </xsl:template>
  <xsl:template match="/">
    <HTML>
      <HEAD>
        <TITLE>Word Reporter Reference</TITLE>
        <STYLE type="text/css">
          table{
          border-width: 1px;
          border-spacing: ;
          border-style: solid;
          border-color: gainsboro;
          border-collapse: collapse;
          background-color: white;
          }
          table th {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 70%;
          text-align: left;
          border-width: 1px;
          padding: 5px;
          border-style: solid;
          border-color: gainsboro;
          background-color: whitesmoke;
          -moz-border-radius: ;
          }
          table td {
          border-width: 1px;
          padding: 5px;
          border-style: solid;
          border-color: gainsboro;
          background-color: white;
          -moz-border-radius: ;
          }

          .fieldName
          {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-weight: bold;
          font-size: 70%;
          }

          .fieldDesc
          {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 70%;
          }

          .sectionTitle
          {
          width: 100%;
          margin-top: 0px;
          margin-left: 0px;
          margin-right: 0px;
          margin-bottom: 0px;
          background-color: gainsboro;
          }

          body
          {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 100%;
          }

          h1
          {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 90%;
          }
          h2
          {
          font-family: Verdana, Arial, Helvetica, sans-serif;
          font-size: 80%;
          }
        </STYLE>

      </HEAD>
      <BODY>
          <div class="sectionTitle">
            <h1>
              Watchfire AppScan WordReporter
            </h1>
            <h2>Mail Merge Field Reference</h2>
          </div>
        <table border="1" cellpadding="2">
          <xsl:apply-templates select="/doc/members/member[starts-with(@name,concat('F:',$WhichType))]" mode="fields"/>
        </table>
      </BODY>
    </HTML>
  </xsl:template>
</xsl:stylesheet>
